package cn.parus.service.Impl;

import cn.parus.entity.FileOperation;
import cn.parus.mapper.FileOperationMapper;
import cn.parus.service.FileOperationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Author: Axel
 * @Description: TODO
 **/


@Service
public class FileOperationServiceImpl extends ServiceImpl<FileOperationMapper, FileOperation> implements FileOperationService {

    @Override
    public Page<FileOperation> searchFileOperation(String operationType, Integer current, Integer size) {
        Page<FileOperation> page = new Page<>(current, size);
        LambdaQueryWrapper<FileOperation> queryWrapper = new LambdaQueryWrapper<>();
        
        if (StringUtils.isNotBlank(operationType)) {
            queryWrapper.like(FileOperation::getOperationType, operationType);
        }
        
        return baseMapper.selectPage(page, queryWrapper);
    }
}
